<!-- : batch portion
@echo off &PUSHD %~DP0 &TITLE 绿化和选项
mode con cols=29 lines=20
color 2F
SetLocal EnableDelayedExpansion
:Menu
Cls
@ echo.
@ echo.　  　  菜 单 选 项
@ echo.
@ echo.       安装 → 请输入1
@ echo.
@ echo.       卸载 → 请输入2
@ echo.
set /p xj= 输入数字按回车：
if /i "%xj%"=="1" Goto Install
if /i "%xj%"=="2" Goto Uninstall
@ echo.
echo      选择无效，请重新输入
ping -n 2 127.1>nul
goto menu

:Uninstall
@reg DELETE HKCR\Lab /f
@del /f /q "%~dp0*.lnk" >NUL2>NUL
goto Uninstall2

:Install
@reg DELETE HKCR\Lab /f
@reg ADD HKCR\Lab /d "lab Protocol"
@reg ADD HKCR\Lab /v "URL Protocol" /d \"\"
@reg ADD HKCR\Lab\DefaultIcon /d "\"%~dp0USTCORi.WebLabClient.exe\""
@reg ADD HKCR\Lab\shell\open\command /d "\"%~dp0USTCORi.WebLabClient.exe\" \"%%1\""
@cls
@set /p id= 输入学号按回车：
call :btoa id "/%id%/op/1/2"

mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0霍尔效应.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzM3Ni8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0迈克尔逊.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzM2Mi8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0偏振光的研究.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzM2MS8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0双臂电桥.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzM1OC8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0刚体转动惯量.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzUxMC8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0落球法测粘滞系数.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzM5NC8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~dp0密里根油滴.lnk""):b.TargetPath=""%~dp0Download\Updata\WebLabClient.exe"":b.Arguments=""lab://LzM2My8xMTguMTg0LjIxNy43My85NTQy%id%/"":b.WorkingDirectory=""%~dp0Download\Updata"":b.Save:close")

@ ECHO.
ECHO 　　　安装完成..
ping -n 2 127.8>nul
goto menu
:Uninstall2
@ ECHO.
ECHO 　　　卸载完成..
ping -n 2 127.8>nul
goto menu

goto :EOF
:btoa <var_to_set> <str>
for /f "delims=" %%I in ('cscript /nologo "%~f0?.wsf" %0 "%~2"') do @set "%~1=%%I"

goto :EOF
: VBScript -->
<job>
       <script language="VBScript">
           Set htmlfile = WSH.CreateObject("htmlfile")
           htmlfile.write("<meta http-equiv='x-ua-compatible' content='IE=10' />")
           WScript.Echo htmlfile.parentWindow.btoa(WSH.Arguments(1))
       </script>
</job>